window.onload = bingocard;
var nums = new Array(76);

function bingocard(){
	if(document.getElementById){
		for(var i=0; i<24; i++){
			setSquare(i);
		}
	}else{
		alert("Sorry,your browser doesn't support this script");
	}
}
function setSquare(thisSquare){
	var currSquare = "square" + thisSquare;
	var colPlace = new Array(0,0,0,0,0,1,1,1,1,1,2,2,2,2,3,3,3,3,3,4,4,4,4,4);
	var colBasis = colPlace[thisSquare] * 15;
	var newnum;
	
	do{
		newnum = colBasis + getNewNum() + 1;
	}
	while(nums[newnum]);
	
	nums[newnum] = true;
	document.getElementById(currSquare).innerHTML = newnum;
}
function getNewNum(){
	return Math.floor(Math.random() * 15);
}
